package com.th.supcom.pds.config.client.mvc;

import net.carefx.framework.container.client.page.PageContext;

import com.extjs.gxt.ui.client.Style.HideMode;
import com.extjs.gxt.ui.client.mvc.AppEvent;
import com.extjs.gxt.ui.client.mvc.Controller;
import com.extjs.gxt.ui.client.mvc.View;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.th.supcom.pds.config.client.common.PhamWindowConfigModuleEvents;
import com.th.supcom.pds.config.client.widget.PhamWindowConfigMainPanel;

/**
 * PhamWindowConfig视图.
 * 
 * 药房窗口属性列表.
 */
public class PhamWindowConfigView extends View
{
    // private PhamWindowConfigView m_view;

    /** 公司版权信息. */
    public static final String copyright = "Copyright 2014, TH Supcom Corporation";

    /** 提交路径. */
    public static final String SCC_BRANCH = "$URL$";

    /** 提交日期. */
    public static final String SCC_LAST_MODIFICATION_DATE = "$Date$";

    /** 最终修改人员. */
    public static final String SCC_LAST_MODIFIER_NAME = "$Author$";

    /** 最终版本号. */
    public static final String SCC_REVISION = "$Revision$";

    /**
     * @param controller
     */
    public PhamWindowConfigView (final Controller controller)
    {
        super (controller);
    }

    @Override
    protected void handleEvent (final AppEvent event)
    {
        if (PhamWindowConfigModuleEvents.UI_INIT.equals (event.getType ()))
        {
            final PageContext context = event.getData ();
            this.initUI (context);
            return;
        }

    }

    /**
     * 初始化容器面板.
     * 
     * @param context
     */
    private void initUI (final PageContext context)
    {
        /** 主窗口容器. */
        final LayoutContainer mainLayoutContainer = context.getContainer ();
        mainLayoutContainer.setLayout (new FitLayout ());
        mainLayoutContainer.setHideMode (HideMode.OFFSETS);
        mainLayoutContainer.add (new PhamWindowConfigMainPanel ());
    }
}